package com.itheima.controller;

import com.itheima.aop.annotation.LogOperater;
import com.itheima.pojo.Result;
import com.itheima.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * @Author：cxl
 * @Package：com.itheima.controller
 * @Project：web-project
 * @name：ReportController
 * @Date：2025-09-29 1:24 pm
 * @Filename：ReportController
 */
@RestController
@Slf4j
@RequestMapping("/report")
public class ReportController {
    @Autowired
    ReportService reportService;

    //员工职位人数统计
    @LogOperater
    @GetMapping("/empJobData")
    public Result empJobData() {
        log.debug("empJobData");
        return Result.success(reportService.empJobData());
    }

    //员工性别统计
    @LogOperater
    public Result empGenderData() {
        log.debug("empGenderData");
        List<Map> genderDatalist = reportService.empGenderData();
        return Result.success(genderDatalist);
    }

    /*学员学历统计*/
    @LogOperater
   public Result studentDegreeData() {
        log.debug("studentDegreeData");
        List<Map> degreeDatalist = reportService.studentDegreeData();
        return Result.success(degreeDatalist);
    }

    /*班级人数统计*/
    @LogOperater
    public Result studentCountData() {
        log.debug("studentCountData");
        return Result.success(reportService.ClazzData());
    }

}
